<template>
	<div>
	<el-scrollbar>
		<el-row>
			<el-col :span="24">
					<el-row v-if="hasPath('base')" justify="start" align="middle" class="item-row" >
						<el-space   alignment="center" :size="10">
							<el-button   v-if="hasPath('base')"  link class="table-title" >【资源】</el-button>
							<el-button   v-if="hasPath('resource')" link class="table-content content-blue" @click="open({name:'resource'})">资源目录</el-button>
							<el-divider   v-if="hasPath('partner')" direction="vertical" />
							<el-button   v-if="hasPath('partner')" link class="table-content" @click="open({name:'partner'})">合作公司</el-button>
							<el-divider  v-if="hasPath('process-step')" direction="vertical" />
							<el-button   v-if="hasPath('process-step')"  link class="table-content" @click="open({name:'process-step'})">加工工序</el-button>
							<el-divider  v-if="hasPath('department')" direction="vertical" />
							<el-button   v-if="hasPath('department')"  link class="table-content" @click="open({name:'department'})">业务部门</el-button>
							<el-divider  v-if="hasPath('employee')" direction="vertical" />
							<el-button   v-if="hasPath('employee')"  link class="table-content" @click="open({name:'employee'})">公司员工</el-button>
							<el-divider   v-if="hasPath('measurement')" direction="vertical" />
							<el-button   v-if="hasPath('measurement')" link class="table-content" @click="open({name:'measurement'})">计量单位</el-button>
						</el-space>
					</el-row>

					<el-divider class="dash-divider" border-style="dashed" />
					<el-row v-if="hasPath('sellMain')" justify="start" align="middle" class="item-row">
						<el-space  alignment="center" :size="10">
							<el-button v-if="hasPath('sellMain')"   link class="table-title" >【销售】</el-button>
							<el-button v-if="hasPath('sell-plan')"  link class="table-content" @click="open({name:'sell-plan'})">报价单</el-button>
							<span v-if="hasPath('sell-order')" > → </span>
							<el-button v-if="hasPath('sell-order')"  link class="table-content content-blue" @click="open({name:'sell-order'})">销售订单</el-button>
							<span v-if="hasPath('sell-analyse')" > → </span>
							<el-button v-if="hasPath('sell-analyse')"  link class="table-content" @click="open({name:'sell-analyse'})">订单MRP分析</el-button>
							<span v-if="hasPath('sell-checkout')" > → </span>
							<el-button v-if="hasPath('sell-checkout')"  link class="table-content content-orange" @click="open({name:'sell-checkout'})">订单发货</el-button>
							<span v-if="hasPath('sell-order-process')" > → </span>
							<el-button v-if="hasPath('sell-order-process')"  link class="table-content content-light-blue" @click="open({name:'sell-order-process'})">订单交货进度</el-button>
						</el-space>
					</el-row>
					<el-divider class="dash-divider" border-style="dashed" />
					<el-row v-if="hasPath('purchaseMain')" justify="start" align="middle" class="item-row">
						<el-space  alignment="center" :size="10">
							<el-button v-if="hasPath('purchaseMain')"   link class="table-title" >【采购】</el-button>
							<el-button v-if="hasPath('purchase-plan')"  link class="table-content" @click="open({name:'purchase-plan'})">采购计划</el-button>
							<span v-if="hasPath('purchase-order')" > → </span>
							<el-button v-if="hasPath('purchase-order')"  link class="table-content content-blue" @click="open({name:'purchase-order'})">采购订单</el-button>
							<span v-if="hasPath('purchase-qt')" > → </span>
							<el-button v-if="hasPath('purchase-qt')"  link class="table-content content-darkblue" @click="open({name:'purchase-qt'})">采购质检</el-button>
							<span v-if="hasPath('purchase-checkin')" > → </span>
							<el-button v-if="hasPath('purchase-checkin')"  link class="table-content content-orange" @click="open({name:'purchase-checkin'})">采购入库</el-button>
							<span v-if="hasPath('purchase-order-process')" > → </span>
							<el-button v-if="hasPath('purchase-order-process')"  link class="table-content content-light-blue" @click="open({name:'purchase-order-process'})">采购到货进度</el-button>
						</el-space>
					</el-row>
					<el-divider class="dash-divider" border-style="dashed" />
					<el-row v-if="hasPath('produceMain')" justify="start" align="middle" class="item-row">
						<el-space  alignment="center" :size="10">
							<el-button v-if="hasPath('produceMain')"   link class="table-title" >【生产】</el-button>
							<el-button v-if="hasPath('produce-order')"  link class="table-content content-blue" @click="open({name:'produce-order'})">生产单</el-button>
							<span v-if="hasPath('produce-order')" > → </span>
							<el-row align="middle">
								<el-col :span="24">
									<el-row align="middle" style="height: 40px">
										<el-space  alignment="center" :size="10">
											<el-button v-if="hasPath('produce-picking-analyse')"  link class="table-content" @click="open({name:'produce-picking-analyse'})">领料分析</el-button>
											<span v-if="hasPath('produce-picking')" > → </span>
											<el-button v-if="hasPath('produce-picking')"  link class="table-content content-orange" @click="open({name:'produce-picking'})">生产领料</el-button>
											<span v-if="hasPath('produce-picking-process')" > → </span>
											<el-button v-if="hasPath('produce-picking-process')"  link class="table-content" @click="open({name:'produce-picking-process'})">领料情况跟踪</el-button>
											<el-divider v-if="hasPath('produce-rest-resource-process')"  direction="vertical" />
											<el-button v-if="hasPath('produce-rest-resource-process')"  link class="table-content" @click="open({name:'produce-rest-resource-process'})">生产余料情况</el-button>
											<el-divider v-if="hasPath('process-step')"  direction="vertical" />
											<el-button v-if="hasPath('process-step')"  link class="table-content" @click="open({name:'process-step'})">工序管理</el-button>
										</el-space>
									</el-row>
									<el-row align="middle" style="height: 40px">
										<el-space  alignment="center" :size="10">
											<el-button v-if="hasPath('produce-steps-analyse')"  link class="table-content" @click="open({name:'produce-steps-analyse'})">工序分析</el-button>
											<span v-if="hasPath('produce-steps-register')" > → </span>
											<el-button v-if="hasPath('produce-steps-register')"  link class="table-content" @click="open({name:'produce-steps-register'})">工序完成登记</el-button>
											<span v-if="hasPath('produce-steps-process')" > → </span>
											<el-button v-if="hasPath('produce-steps-process')"  link class="table-content" @click="open({name:'produce-steps-process'})">工序完成情况</el-button>
										</el-space>
									</el-row>
									<el-row align="middle" style="height: 40px">
										<el-space  alignment="center" :size="10">
											<el-button v-if="hasPath('produce-qt')"  link class="table-content content-darkblue" @click="open({name:'produce-qt'})">生产质检</el-button>
											<span v-if="hasPath('produce-qt')" > → </span>
											<el-button v-if="hasPath('produce-checkin')"  link class="table-content content-orange" @click="open({name:'produce-checkin'})">生产入库</el-button>
											<span v-if="hasPath('produce-order-process')" > → </span>
											<el-button v-if="hasPath('produce-order-process')"  link class="table-content content-light-blue" @click="open({name:'produce-order-process'})">生产入库进度</el-button>


										</el-space>
									</el-row>
								</el-col>
							</el-row>
						</el-space>
					</el-row>
					<el-divider class="dash-divider" border-style="dashed" />
					<el-row v-if="hasPath('entrustMain')" justify="start" align="middle"  class="item-row">
						<el-space  alignment="center" :size="10">
							<el-button v-if="hasPath('entrustMain')"   link class="table-title" >【委外】</el-button>
							<el-button v-if="hasPath('entrust-order')"  link class="table-content" @click="open({name:'entrust-order'})">委外单</el-button>
							<span v-if="hasPath('entrust-order')" > → </span>
							<el-row align="middle">
								<el-col :span="24">
									<el-row align="middle" style="height: 40px">
										<el-space  alignment="center" :size="10">
											<el-button v-if="hasPath('entrust-sending-analyse')"  link class="table-content" @click="open({name:'entrust-sending-analyse'})">发料分析</el-button>
											<span v-if="hasPath('entrust-sending')" > → </span>
											<el-button v-if="hasPath('entrust-sending')"  link class="table-content content-orange" @click="open({name:'entrust-sending'})">委外发料</el-button>
											<span v-if="hasPath('entrust-sending-process')" > → </span>
											<el-button v-if="hasPath('entrust-sending-process')"  link class="table-content" @click="open({name:'entrust-sending-process'})">发料情况跟踪</el-button>
											<el-divider v-if="hasPath('entrust-rest-resource-process')"  direction="vertical" />
											<el-button v-if="hasPath('entrust-rest-resource-process')"  link class="table-content" @click="open({name:'entrust-rest-resource-process'})">加工余料情况</el-button>
										</el-space>
									</el-row>
									<el-row align="middle" style="height: 40px">
										<el-space  alignment="center" :size="10">
											<el-button v-if="hasPath('entrust-qt')"  link class="table-content content-darkblue" @click="open({name:'entrust-qt'})">委外质检</el-button>
											<span v-if="hasPath('entrust-qt')" > → </span>
											<el-button v-if="hasPath('entrust-checkin')"  link class="table-content content-orange" @click="open({name:'entrust-checkin'})">委外入库</el-button>
											<span v-if="hasPath('entrust-order-process')" > → </span>
											<el-button v-if="hasPath('entrust-order-process')"  link class="table-content content-light-blue" @click="open({name:'entrust-order-process'})">委外入库进度</el-button>
										</el-space>
									</el-row>
								</el-col>
							</el-row>
						</el-space>
					</el-row>
				<el-divider class="dash-divider" border-style="dashed" />
				<el-row v-if="hasPath('check-stock')" justify="start" align="middle"  class="item-row">
					<el-space  alignment="center" :size="10">
						<el-button v-if="hasPath('check-stock')"   link class="table-title" >【出库】</el-button>
						<el-button v-if="hasPath('checkout-sell-checkout')"  link class="table-content" @click="open({name:'checkout-sell-checkout'})">销售出货</el-button>
						<el-divider v-if="hasPath('checkout-produce-picking')"  direction="vertical" />
						<el-button v-if="hasPath('checkout-produce-picking')"  link class="table-content" @click="open({name:'checkout-produce-picking'})">生产领料</el-button>
						<el-divider v-if="hasPath('checkout-entrust-sending')"  direction="vertical" />
						<el-button v-if="hasPath('checkout-entrust-sending')"  link class="table-content" @click="open({name:'checkout-entrust-sending'})">委外发料</el-button>
						<el-divider v-if="hasPath('checkout-other-checkout')"  direction="vertical" />
						<el-button v-if="hasPath('checkout-other-checkout')"  link class="table-content" @click="open({name:'checkout-other-checkout'})">其他领用</el-button>
						<el-divider v-if="hasPath('resource-transfer')"  direction="vertical" />
						<el-button v-if="hasPath('resource-transfer')"  link class="table-content" @click="open({name:'resource-transfer'})">库存调拨</el-button>
					</el-space>
				</el-row>
				<el-divider class="dash-divider" border-style="dashed" />
				<el-row v-if="hasPath('check-stock')" justify="start" align="middle" class="item-row">
					<el-space  alignment="center" :size="10">
						<el-button v-if="hasPath('check-stock')"   link class="table-title" >【入库】</el-button>
						<el-button v-if="hasPath('checkin-purchase-checkin')"  link class="table-content" @click="open({name:'checkin-purchase-checkin'})">采购入库</el-button>
						<el-divider v-if="hasPath('checkin-produce-checkin')"  direction="vertical" />
						<el-button v-if="hasPath('checkin-produce-checkin')"  link class="table-content" @click="open({name:'checkin-produce-checkin'})">生产入库</el-button>
						<el-divider v-if="hasPath('checkin-entrust-checkin')"  direction="vertical" />
						<el-button v-if="hasPath('checkin-entrust-checkin')"  link class="table-content" @click="open({name:'checkin-entrust-checkin'})">委外入库</el-button>
						<el-divider v-if="hasPath('checkin-other-checkin')"  direction="vertical" />
						<el-button v-if="hasPath('checkin-other-checkin')"  link class="table-content" @click="open({name:'checkin-other-checkin'})">其他入库</el-button>
						<el-divider v-if="hasPath('resource-transfer')"  direction="vertical" />
						<el-button v-if="hasPath('resource-transfer')"  link class="table-content" @click="open({name:'resource-transfer'})">库存调拨</el-button>
					</el-space>
				</el-row>
				<el-divider class="dash-divider" border-style="dashed" />
				<el-row v-if="hasPath('credit')" justify="start" align="middle" class="item-row">
					<el-space :size="10"  alignment="center" >
						<el-button v-if="hasPath('credit')"   link class="table-title" >【账款】</el-button>
						<div>
							<el-button v-if="hasPath('payment-receive')"  link class="table-content content-pink"  @click="open({name:'payment-receive'})">收货款</el-button>
							<el-divider v-if="hasPath('payment-expend')"  direction="vertical" />
							<el-button v-if="hasPath('payment-expend')"  link class="table-content content-pink" @click="open({name:'payment-expend'})">付货款</el-button>
						</div>
						<span v-if="hasPath('payment-customer-detail')" > → </span>
						<el-button v-if="hasPath('payment-customer-detail')"  link class="table-content" @click="open({name:'payment-customer-detail'})">客户欠款明细</el-button>
						<el-divider v-if="hasPath('payment-customer-summary')"  direction="vertical" />
						<el-button v-if="hasPath('payment-customer-summary')"  link class="table-content" @click="open({name:'payment-customer-summary'})">客户欠款汇总</el-button>
						<el-divider v-if="hasPath('payment-supplier-detail')"  direction="vertical" />
						<el-button v-if="hasPath('payment-supplier-detail')"  link class="table-content" @click="open({name:'payment-supplier-detail'})">供应商欠款明细</el-button>
						<el-divider v-if="hasPath('payment-supplier-summary')"  direction="vertical" />
						<el-button v-if="hasPath('payment-supplier-summary')"  link class="table-content" @click="open({name:'payment-supplier-summary'})">供应商欠款汇总</el-button>
						<el-divider v-if="hasPath('payment-detail')"  direction="vertical" />
						<el-button v-if="hasPath('payment-detail')"  link class="table-content" @click="open({name:'payment-detail'})">收支明细表</el-button>
						<el-divider v-if="hasPath('payment-summary')"  direction="vertical" />
						<el-button v-if="hasPath('payment-summary')"  link class="table-content" @click="open({name:'payment-summary'})">收支汇总表</el-button>
					</el-space>
				</el-row>
				<el-divider class="dash-divider" border-style="dashed" />
				<el-row v-if="hasPath('stat')" justify="start" align="middle" class="item-row">
					<el-space  alignment="center" :size="10">
						<el-button v-if="hasPath('stat')"   link class="table-title" >【报表】</el-button>
						<el-row align="middle">
							<el-col :span="24">
								<el-row align="middle" style="height: 40px">
									<el-space  alignment="center" :size="10">
										<el-button v-if="hasPath('stock-resource')"  link class="table-content content-red"  @click="open({name:'stock-resource'})">库存查询</el-button>
										<el-divider v-if="hasPath('stock-checkin-detail')"  direction="vertical" />
										<el-button v-if="hasPath('stock-checkin-detail')"  link class="table-content" @click="open({name:'stock-checkin-detail'})">入库明细表</el-button>
										<el-divider v-if="hasPath('stock-checkin-summary')"  direction="vertical" />
										<el-button v-if="hasPath('stock-checkin-summary')"  link class="table-content" @click="open({name:'stock-checkin-summary'})">入库汇总表</el-button>
										<el-divider v-if="hasPath('stock-checkout-detail')"  direction="vertical" />
										<el-button v-if="hasPath('stock-checkout-detail')"  link class="table-content" @click="open({name:'stock-checkout-detail'})">出库明细表</el-button>
										<el-divider v-if="hasPath('stock-checkout-summary')"  direction="vertical" />
										<el-button v-if="hasPath('stock-checkout-summary')"  link class="table-content" @click="open({name:'stock-checkout-summary'})">出库汇总表</el-button>
										<el-divider v-if="hasPath('produce-salary-detail')"  direction="vertical" />
										<el-button v-if="hasPath('produce-salary-detail')"  link class="table-content" @click="open({name:'produce-salary-detail'})">工资明细表</el-button>
										<el-divider v-if="hasPath('produce-salary-summary')"  direction="vertical" />
										<el-button v-if="hasPath('produce-salary-summary')"  link class="table-content" @click="open({name:'produce-salary-summary'})">工资汇总表</el-button>
									</el-space>
								</el-row>
								<el-row align="middle" style="height: 40px">
									<el-space  alignment="center" :size="10">
										<el-button v-if="hasPath('inventory-detail')"  link class="table-content" @click="open({name:'inventory-detail'})">进出存明细表</el-button>
										<el-divider v-if="hasPath('inventory-summary')"  direction="vertical" />
										<el-button v-if="hasPath('inventory-summary')"  link class="table-content" @click="open({name:'inventory-summary'})">进出存汇总表</el-button>
										<el-divider v-if="hasPath('customer-bill-check-detail')"  direction="vertical" />
										<el-button v-if="hasPath('customer-bill-check-detail')"  link class="table-content" @click="open({name:'customer-bill-check-detail'})">客户对账明细表</el-button>
										<el-divider v-if="hasPath('customer-bill-check-summary')"  direction="vertical" />
										<el-button v-if="hasPath('customer-bill-check-summary')"  link class="table-content" @click="open({name:'customer-bill-check-summary'})">客户对账汇总表</el-button>
										<el-divider v-if="hasPath('produce-cost-analyse')"  direction="vertical" />
										<el-button v-if="hasPath('produce-cost-analyse')"  link class="table-content" @click="open({name:'produce-cost-analyse'})">生产成本分析</el-button>
										<el-divider v-if="hasPath('checkout-profit-detail')"  direction="vertical" />
										<el-button v-if="hasPath('checkout-profit-detail')"  link class="table-content" @click="open({name:'checkout-profit-detail'})">利润统计表</el-button>
									</el-space>
								</el-row>
							</el-col>
						</el-row>
					</el-space>
				</el-row>

			</el-col>
		</el-row>
	</el-scrollbar>
	</div>
</template>

<script>
export default {
	name: "myguide",
	methods:{
		open(data){
			try {
				this.$router.push(data)
			}
			catch(err){
				this.$message.warning("您没有当前页面的权限")
			}

		},
		 hasPath(name) {
			var router = this.$router.sc_getMenu();
			var arr = this.getPath(router);
			return arr.indexOf(name) > -1;
		},
		getPath(router){
			var arr = [];
			for(let r of router){
				let name = r.name
				let children = r.children
				// 如果有子元素，不添加父元素的路径
				arr.push(name)
				if(children && children.length > 0){
					arr = arr.concat(this.getPath(children))
				}
			}
			return arr;
		}
	}
}
</script>

<style scoped>
.item-row {

}

.dash-divider{
	margin: 13px 0 !important;
}

.map-con {
	height: 305px;
}

.map-incon {
	height: 100%;
}

.data-source-row {
	height: 273px;
}

.line-chart-con {
	height: 150px;
}

.inner-container::-webkit-scrollbar {
	display: none;
}

.qr {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 10px;

}

.qr div {
	text-align: center;
	font-size: 12px;
	line-height: 16px;
}

.flex {
	margin: 10px 0;
}

.rmb {
	margin-left: 0;
	line-height: 30px;
	color: #d7282d;
	font-size: 18px;
	font-weight: 700;
}

.price {
	font-size: 28px;
	line-height: 30px;
	margin-left: 2px;
	color: #d7282d;
	font-weight: 700;
	margin-right: 5px;
}

.origin {
	font-size: 13px;
	color: #999;
	line-height: 24px;
}

.ps {
	line-height: 25px;
	font-family: Microsoft YaHei;
	font-size: 12px;
	display: inline-block;
	background: #f7f7f7;
	margin: 0 3px;
	padding: 1px 5px;
	border-radius: 3px;
	color: #666;
	border: 1px solid #eee;
}


.table-title{
	font-size: 14px !important;
	color: #008020;
}

.table-content{
	font-size: 14px !important;
}

.content-blue{
	color:#2d8cf0;
}

.content-red{
	color:red;
}

.content-orange{
	color:orangered;
}

.content-darkblue{
	color: darkblue;
}

.content-light-blue{
	color:lightseagreen;
}

.content-pink{
	color:darkviolet;
}

</style>
